﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Resources;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using GBlason.Properties;
using GBlason.ViewModel;
using GBlason.ViewModel.Control;
using GBlason.ViewModel.General;

namespace GBlason.Control.Aggregate
{
    /// <summary>
    /// Interaction logic for ApplicationStatusBar.xaml
    /// </summary>
    public partial class ApplicationStatusBar
    {
        public ApplicationStatusBar()
        {
            InitializeComponent();
        }

        private void CommandComboBoxSelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (e.AddedItems.Count == 0) return;
            var zoomLevel = e.AddedItems[0] as ZoomLevelViewModel;
            var rm = new ResourceManager(typeof (Resources));
            var file = ZoomStatusBarItem.DataContext as GbsFileViewModel;
            if (zoomLevel == null || zoomLevel.Name != rm.GetString("ZoomFitToScreen") || file == null) return;
            file.ZoomLevel = zoomLevel.Value = file.RatioToFitToScreen();
        }
    }
}
